;; EX-43.scm - Tank 

;; This file is a translation of an example James McCartney posted to
;; sc-users on Mon Apr 5 15:58:30 PDT 2004.  It demonstrates the
;; LocalIn and LocalOut UGens.  There is a variant in the LocalIn help
;; file.  This can take a while for the first impulse to sound...

(let ((f (lambda () 
	   (Pan2.ar (Mul (Decay2.ar (Dust.ar 0.02) 0.1 0.5 0.1)
			 (Cubed (FSinOsc.ar (ExpRand.ir 300 2200))))
		    (Rand.ir -1 1)))))
  (seq (local (Mul (LocalIn.ar 2) 0.98))
       (OnePole.ar local 0.33)
       (Rotate2.ar (ref local 0) (ref local 1) 0.23)
       (AllpassN.ar local 0.05 (randomF-list 2 0.01 0.05) 2)
       (DelayN.ar local 0.3 (list 0.17 0.23))
       (AllpassN.ar local 0.05 (randomF-list 2 0.03 0.15) 2)
       (LeakDC.ar local)
       (Add local
	    (seq (in (Mix.fill 8 f))
		 (Add in (Pan2.ar (Mul (Decay2.ar (Dust.ar 0.01) 0.04 0.3) 
				       (BrownNoise.ar))))
		 (AllpassN.ar in 0.03 (random-list 2 0.005 0.02) 1)
		 (AllpassN.ar in 0.03 (random-list 2 0.005 0.02) 1)
		 (AllpassN.ar in 0.03 (random-list 2 0.005 0.02) 1)
		 (AllpassN.ar in 0.03 (random-list 2 0.005 0.02) 1)))
       (begin (LocalOut.ar local) local)))
